package br.ita.battlefarm.views;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.view.View;

public class MessageView extends View {

	private Integer clickCount;
	private Paint white;
	private String text;
	
	public MessageView(Context context) {
		super(context);
		clickCount = 0;
		text = new String();
		white = new Paint();
		white.setARGB(255, 255, 255, 255);
		white.setTextSize(20);
	}

	public void incrementCount(){
		clickCount++;
		invalidate();
	}
	
	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
		drawCount(canvas);	
	}

	private void drawCount(Canvas canvas) {
		canvas.drawText(text, 10, 30, white);
	}
	
	public void setText( String text ){
		this.text = text;
		invalidate();
	}
	
}
